#include "mayui.h"

#include "selector.h"
#include "render.h"

#include "widget/widget.h"
#include "widget/bar.h"
#include "widget/img.h"
#include "widget/label.h"
#include "widget/tail.h"
#include "selector.h"

typedef struct{
    int ui_w,ui_h;
    may_screen_t *screen;
}mayui_t;

mayui_t mayui;


void mayui_init(int ui_w, int ui_h)
{
    mayui.ui_w = ui_w;
    mayui.ui_h = ui_h;

    render_widget_func_register(widget_type_bar,bar_render);
    render_widget_func_register(widget_type_img,img_render);
    render_widget_func_register(widget_type_lable,label_render);
    render_widget_func_register(widget_type_tail_view,tail_view_render);

    list_init(&mayui.screen);
    selector_init(&mayui.screen);
}

void mayui_set_screen(may_screen_t* screen)
{
    mayui.screen = screen;
}

void mayui_main_loop(void)
{
    //获取选中
    //渲染
    //输出
}